package com.grao.waterschool.human.controller;

import com.grao.waterschool.human.common.R;
import com.grao.waterschool.human.manager.service.CapturePicService;
import com.grao.waterschool.human.manager.service.ICCAuthorizeService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Tag(name = "ICC认证登陆/不用操作，登陆使用SaToken登陆")
@Slf4j
@RestController
@RequestMapping("/icc/")
public class ICCAuthorizeController {

    @Autowired
    ICCAuthorizeService iccService;

    @Autowired
    CapturePicService capturePicService;


    @PostMapping("login")
    public Map<String, String> login() throws Exception {

        return iccService.loginForICC();
    }

    @GetMapping("getHistoryPic")
    public R getHistoryPic() throws Exception {
        capturePicService.getHistoryPic();
        return R.success();
    }
}
